package com.yk.anima.response;

import lombok.ToString;


@ToString
public enum CommonCode implements ResultCode {
    INVALID_PARAM(false, 1003, "非法参数异常"),
    SUCCESS(true, 10000, "操作成功！"),
    FAIL(false, 11111, "操作失败！"),
    UNAUTHENTICATED(false, 10001, "此操作需要登陆系统！"),
    UNAUTHORISE(false, 10002, "权限不足，无权操作！"),
    USERNAMEANDPASSWORD(false, 10003, "用户名或者密码不能为空"),
    USERNAME(false, 10004, "用户名不存在或密码不对"),
    CATNULL(false, 1005, "该猫不存在"),
    UPDATEFAIL(false, 1006, "修改失败"),
    FINDALLANDNULL(false,1007,"空空入也"),
    FindPageNull(false, 404, "找不到该页面"),
    VALIDATECODE(false,1008,"验证码不可以为空"),
   PHONEISNULL(false,1009,"手机号已经存在"),
    USERNOLOGIN(false,1000,"用户未登录,退出失败"),
    SERVER_ERROR(false, 99999, "抱歉，系统繁忙，请稍后重试！");

    //    private static ImmutableMap<Integer, CommonCode> codes ;
//操作是否成功
    boolean success;
    //操作代码
    int code;
    //提示信息
    String message;


    private CommonCode(boolean success, int code, String message) {
        this.success = success;
        this.code = code;
        this.message = message;
    }

    @Override
    public boolean success() {
        return success;
    }

    @Override
    public int code() {
        return code;
    }

    @Override
    public String message() {
        return message;
    }


}
